#ifndef PLAYER_HPP
#	define PLAYER_HPP

#	include "Chessboard.hpp"
#	include "Piece.hpp"
#	include "Chess.hpp"
#	include <iostream>
#	include <map>

using namespace std;

#	define ROOK_INIT_0_X 		0
#	define ROOK_INIT_1_X 		7
#	define KNIGHT_INIT_0_X 		1
#	define KNIGHT_INIT_1_X 		6
#	define BISHOP_INIT_0_X 		2
#	define BISHOP_INIT_1_X 		5
#	define QUEEN_INIT_X 		3
#	define KING_INIT_X 			4
#	define QUEEN_WHITE_INIT_X	QUEEN_INIT_X
#	define QUEEN_BLACK_INIT_X	KING_INIT_X
#	define KING_WHITE_INIT_X	KING_INIT_X
#	define KING_BLACK_INIT_X	QUEEN_INIT_X
#	define PAWN_INIT_Y			0

class Action;
class Pawn;
class Bishop;
class King;

struct PlayerPiecesInfos
{
	unsigned int	nb_bishops;
	unsigned int	nb_pawns;
	unsigned int	nb_knights;
	unsigned int	nb_queens;
	unsigned int	nb_rooks;
	
	list<Bishop*>	bishops;
};

class Player
{
	public:
		
		
		Player(Chess::Color color);
		~Player();
		
		void					addAction(Action* action);
		const map<unsigned int, list<Action*> >& getActions() const;
		
		const list<Piece*>&		getPieces() const;
		list<Position*>			getAllPossiblePositions() const;
		void					getPlayerPiecesInfos(PlayerPiecesInfos* pieces_infos);
		King*					getKing() const;
		void					incrChecks();
		void					incrNbTurns();
		unsigned int			getNbChecks() const;
		unsigned int			getNbPieces() const;
		unsigned int			getNbTurns() const;
		Piece*					checkPromotablePawn()	const;
		CastlingState			checkCastling() const;
		void					addPiece(Piece* piece);
		void					removePiece(Piece* piece);
		Chess::Color			getColor() const;
		void					displayDbg();
		
	private:		
		Chess::Color 						color;
		list<Piece*>						pieces;
		unsigned int						nb_checks;
		unsigned int						nb_turns;
		bool								checkmate;
		map<unsigned int, list<Action*> >	actions;
		King*								king;

		void					setInitPieces();
		

};


#endif
